<template>
  <div class="button-container">
    <el-button
        type="primary"
        icon="el-icon-arrow-left"
        @click="goBack"
        class="back-btn"
    >
      返回列表
    </el-button>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const goBack = () => {
  router.go(-1)
}
</script>

<style scoped>
.button-container {
  display: flex;
  justify-content: flex-start;
  padding: 0;
  margin-bottom: 20px;
}

.back-btn {
  margin-left: 0;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  border: none;
  background: linear-gradient(135deg, #409EFF, #67C23A);
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(64, 158, 255, 0.3);
}

.back-btn:active {
  transform: translateY(0);
}

.back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
      120deg,
      transparent,
      rgba(255, 255, 255, 0.3),
      transparent
  );
  transition: 0.5s;
}

.back-btn:hover::before {
  left: 100%;
}

.back-btn i {
  margin-right: 8px;
  font-weight: bold;
}
</style>